
<script type="text/x-red" data-template-name="device-gateway">
    <div class="form-row">
        <label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
        <input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
    </div>

    <div class="form-row">
        <label for="node-input-timeout"><i class="fa fa-calendar"></i> <span>超时时间</span></label>
        <input type="text" id="node-input-timeout" placeholder="会话超时时间,单位秒">
    </div>
</script>

<script type="text/text">
    RED.nodes.registerType('device-gateway',{
        color:"#33CC99",
        category: 'function',
        name:"设备网关",
        defaults: {
            name: {value:""},
            timeout: {value:"",validate:RED.validators.number(true)}
        },
        inputs:1,
        outputs:1,
        icon: "gateway.svg",
        label: function() {
            return this.name||"设备网关";
        },
        labelStyle: function() {
            return this.name?"node_label_italic":"";
        },
        oneditprepare: function() {

        },
        oneditsave: function() {

        },
        oneditcancel: function() {

        },
        oneditresize: function(size) {

        }
    });
</script>
